package Test;

class B{
    public B(){
        func();
    }

    public void func(){
        System.out.println("B.func()");
    }
}

class D extends B{
    private int num = 1;

    @Override
    public void func() {
        System.out.println("D.func() "+num);
    }
}


abstract class Shape{
    public static int a = 10;
    //抽象方法
    public abstract void draw();
//    abstract int b = 10;  error
    public void func(){
//private abstract void draw(); error
    }
}
class Rect extends Shape{
    @Override
    public void draw() {
        System.out.println("矩形");
    }
}

abstract class A extends Shape{

}

class Bc extends A{
    @Override
    public void draw() {
        System.out.println("skdhisuh");
    }
}



public class Test {

    public static void drawMap(Shape shape){
        shape.draw();
    }


    public static void main(String[] args) {
        D d = new D();
//        Shape shape = new Shape(); 不能实例化抽象类
Shape shape = new Rect();
drawMap(new Rect());



    }
}
